import Vue from 'vue'
import App from './App'
import VueRouter from 'vue-router'
import VueLazyload from 'vue-lazyload';
import VueAwesomeSwiper from 'vue-awesome-swiper'

import routes from './router/index.js'
import 'normalize.css'
import './assets/js/rem.js'
import './assets/js/common.js'

// 启用路由
Vue.use(VueRouter)
// 启用 swiper
Vue.use(VueAwesomeSwiper)

//生成路由实例
const router = new VueRouter({
  // mode: 'history', //切换路径模式，变成history模式
  mode: 'hash', //更改了打包路径
  base: __dirname,
  routes
});

//图片懒加载
Vue.use(VueLazyload, {
  preLoad: 1.3,
  error: 'http://static.freepik.com/free-photo/error-2_318-10733.jpg',
  loading: 'http://img.zcool.cn/community/010f4a56629d0932f8754573ff900d.gif',
  attempt: 1
})
Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: { App }
})
